package com.xuelang.pipeline.client.resource.enums;

import lombok.Getter;

/**
 * <p>工具链（制品工具）存储策略枚举</p>
 *
 * @author : yixin.lys
 * @date : 2024-07-09 10:13
 **/
@Getter
public enum StrategyType {
    RELEASE(1),
    SNAPSHOT(2),
    MIXED(3);

    private final int value;

    StrategyType(int value) {
        this.value = value;
    }

    public static StrategyType fromValue(int value) {
        switch (value) {
            case 1:
                return RELEASE;
            case 2:
                return SNAPSHOT;
            case 3:
                return MIXED;
            default:
                throw new IllegalArgumentException("Unknown value: " + value);
        }
    }
}
